package cn.edu.thu.laud.thrift.customed;
import org.apache.cassandra.thrift.Cassandra;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.thrift.TProcessor;
import org.apache.thrift.TProcessorFactory;
import org.apache.thrift.transport.TTransport;

import cn.edu.thu.laud.server.thrift.LaUD;

  public  class CustomedLaUDProcessorFactory extends TProcessorFactory {
    private final HiveConf conf;
    private  final Cassandra.Iface cassandraIface;
    private  final LaUD.Iface laudIface;
    public CustomedLaUDProcessorFactory(TProcessor processor, HiveConf conf,Cassandra.Iface cassandraIface,LaUD.Iface laudIface) {
      super(processor);
      this.conf = conf;
      this.cassandraIface=cassandraIface;
      this.laudIface=laudIface;
    }

    @Override
    public TProcessor getProcessor(TTransport trans) {
      try {
        return new CustomedLaUDProcessor(this.cassandraIface,this.laudIface,conf);
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
  }